﻿using DalatCooking.Core.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DalatCooking.Core;

public partial class admin_Course_OrderDetail : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected override void OnInit(EventArgs e)
    {
        Orders od = OrdersManager.FindById(OrderID);
        lblPerson.Text = PersonManager.FindById(od.PersonID).Profile.DisplayName;
        lblDateCreated.Text = od.DateCreated.ToShortDateString();

        rpt.DataSource = OrdersManager.FindOrderDetail(od.OrderID);
        rpt.DataBind();
        base.OnInit(e);
    }
    public int OrderID
    {
        get
        {
            if (!String.IsNullOrEmpty(Request.QueryString["OrderID"]))
            {
                return ConvertObject.ToInt(Request.QueryString["OrderID"]);
            }
            return -1;
        }
    }
    public string GetProductName(object pId)
    {
        Course p = CourseManager.Single(ConvertObject.ToInt(pId));
        return (p != null) ? p.Name : "";
    }
}